import fromItem from '@/components/from-item/from-item.vue'
var maxNum = 6;
var sourceType = [
	['camera'],
	['camera', 'album']
];

export default {
	components: {
		fromItem,
	},
	data() {
		return {
			totalData: {
				fId: "",
				fCompanyid: "", //所属标段
				fCompanyname: "", //所属标段
				fProjectid: "", //项目id 隐藏
				fProjectname: "", //项目简称
				fEngineeringpartid: "", //工程部位id
				fEngineeringpartname: "", //工程部位
				fCheckcompany: "", //检测单位
				fEquipname: "", //设备编号
				fTaskno: "", //任务单号
				fCreatedates: "", //创建时间时分秒不可编辑
				fCreateuserid: "", //当前登录人id
				fCreateusername: "", //当前登录
				fChecktype: "", //检测类型
				fWitnessid: "", //委托编号id
				fWitnessno: "", //委托编号
				fNature: "", // 当前登录用户的机构性质
				userId: "", //当前登录人id
				userName: "", //当前登录人姓名

				fSpecimenage: '', //龄期
				fConcretelevel: "", //设计强度等级(MPa)
				fConcretetype: "", //是否为泵送混凝土
				fSurface: "", //测面状态
				fAngle: "", //测试角度

				fThicknessdesignvalue: "", //设计厚度
				fCorrectionfactor: "", //垫块厚度
				fAllowdeviation1: "", //允许偏差(+mm)
				fAllowdeviation: "", //允许偏差(mm)
				isSubmit: "0", //0 保存 1提交
			},


			userInfo: null,
			options: null, //上个页面传递过来的参数
		};
	},

	onReady() {},

	onLoad(options) {
		// console.log('options', options);
		var that = this;
		uni.getStorage({ //监督检查方式
			key: 'userInfo',
			success: function(res) {
				that.userInfo = JSON.parse(res.data);
			}
		});

		that.options = options;
		that.getInfoMsg(options.id);
		// || MP-WEIXIN || H5
		// #ifdef APP-PLUS

		// #endif
		// #ifdef H5

		// #endif

	},
	onShow() {},
	onUnload() {},
	// // 返回
	// onBackPress(event) {
	// 	uni.navigateTo({
	// 		url: "/pages/apply/fieldTestManage/fieldReboundDetection/testing/index"
	// 	});
	// 	return true;
	// },
	methods: {
		getInfoMsg(id) {
			this.$http.getFieldtestCheckTaskByFid({
				fId: id, //数据id
				fChecktype: "回弹检测"
			}).then(res => {
				if (res.errcode == 0) {
					var that = this;
					that.totalData = res.data.pileTask;
				} else {
					uni.showToast({
						title: "请求失败",
						icon: 'none',
						duration: 2000
					});
				}
			}, (err) => {
				uni.showToast({
					title: "接口报错",
					icon: 'none',
					duration: 2000
				});
			})
		},
	}
}
